historyNN 2   IE 3   DOM n/a

During a browser session, the browser uses the history object to maintain a list of URLs visited by the user. This list (stored as an array) is used by the browser to assist with navigation via the Back and Forward buttons. Due to the sensitive nature of the private information stored in the history object, not many of the details are exposed to scripts that could capture such information and surreptitiously submit it to a server. In more recent browser versions, each window maintains its own history object.

 
 
Object Model Reference
NN [window.]history
IE [window.]history
lengthNN 2   IE 3   DOM n/a
 Read-only
 

The number of items in the history list. Even with this information, you are not allowed to extract a specific history entry except with signed scripts and the user's permission in Navigator 4 or later.

 
Example
if (history.length > 4) {
    ...
}
 
Value
Integer.
 
Default None.
back( )NN 2   IE 3   DOM n/a

The basic action is to navigate to the previously viewed document, similar to the click of the browser's Back button. In Navigator 4, however, you can direct the back( ) method to a specific window or frame, thus bypassing the default behavior of the Back button. For example, repeated calls to parent.otherFrame.history.back( ) eventually run out of history for the frame and cease to do anything further. On the other hand, repeated calls to top.history.back( ) are the same as clicking the Back button, conceivably backing out of the frameset entirely if it wasn't the first document loaded in the current browser session.

 
Returned Value
None.
 
Parameters
None.
forward( )NN 2   IE 3   DOM n/a

The basic action is to navigate to the same URL that the browser's Forward button leads to (if it is active). Similar cautions about the window's history from the history.back( ) method apply here, as well.

 
Returned Value
None.
 
Parameters
None.
go( )NN 2   IE 3   DOM n/a

go(stepCount | "URL")

Navigates to a specific position in the history listing.

 
Returned Value
None.
 
Parameters
stepCount An integer representing how many items away from the current listing the browser should use to navigate. A value of zero causes the current page to reload; a value of -1 is the same as back( ); a value of -2 is the URL two steps back from the current item in history. A bug in IE 3 causes all values other than 0 to be treated as -1.
URL A URL or (in Navigator) document title stored in the history listing.